<template>
    <div>
        <Header title='预订结果' />
        <div class="div-img">
            <img v-if="status==200" src="/img/success.png" width="300" height="300"/>
            <img v-else src="/img/fail.png" width="300" height="300"/>
            <br/><br/><br/><br/><br/>
            <el-button type="success" round @click="gohome">返回首页</el-button>
        </div>

    </div>
</template>
<script>
import Header from '../../components/Header/Header'
export default {
    name:'Buy',
    data(){
        return{
            msg:'系统正在排队出货.....',
            status:0
        }
    },
    components:{
        Header
    },
    mounted() {
        // 获取是否购买成功数据
        this.$api.buyaction({id:this.$route.params.id,user:this.$route.params.user})
        .then(data=>{
            // console.log(data)
            this.msg = data.data.msg;
            this.status = data.data.status;
        })
    },
    methods:{
        gohome: function (){
            this.$router.push("/");
        }
    }

}
</script>
<style>
.div-img{
    width: 100%;
    height: 100%;
    text-align: center;
}
.div-img img{
    margin-top: 100px;
}
</style>